package com.mybatisplus.multidatasource.member.service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.mybatisplus.multidatasource.member.entity.UserEntity;
import com.mybatisplus.multidatasource.member.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: J.K
 * @Date: 2021-09-22 10:03
 * @Description:
 */
@RestController
@DS(value = "mybatis_plus_user")
public class UserService {
    @Resource
    private UserMapper userMapper;

    @GetMapping("/findByUserId")
    public UserEntity findByUserId(Long userId) {
        return userMapper.selectById(userId);
    }
}
